// _private/cpt/swiper/index.js
const { $wx } = getApp()
Component({
    properties: {
        data: null,
        height: { type: Number, value: 350},
        hasTitle:Boolean
    },
    data: {
        current: 0,
    },
    methods: {
        onChange({ detail:{ current } }){
            if(this.data.hasTitle){
                this.setData({ current })
            }
        },
        onTap({ currentTarget: { dataset: { item:{url, title}, index } }  }){
            if( url ){
                $wx.h5({ url, title })
            }else{
                this.triggerEvent('tap', { item, index })
            }
        }
    }
})
